package com.chuang.server.pojo;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.util.List;

@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
public class ResultPageBean {
    private long code;
    private String message;
    private List<?> data;
    private Long total;
    private Long size;
    private Long current;
    private Long pages;
    /*
    * 返回成功结果 无数据
    * */
    public static ResultPageBean success(String message, List<?> list){
        return new ResultPageBean(200,message,list,0l,0l,0l,0l);
    }
    /*
     * 返回成功结果 有数据
     * */
    public static ResultPageBean success(String message, List<?> list,Long total,Long size,Long current,Long pages){
        return new ResultPageBean(200,message,list,total,size,current,pages);
    }
    /*
     * 返回失败结果 无数据
     * */
    public static ResultPageBean error(String message){
        return new ResultPageBean(500,message,null,0l,0l,0l,0l);
    }

 }
